# 进程
from multiprocessing import Process


class Myprocess(Process):
    def __init__(self, name):
        super(Myprocess, self).__init__()
        self.name = name

    # 进程线程重写run方法
    def run(self):
        # 可以试着把方法写进run里面?
        n = 1
        while True:
            print('{}---->自定义进程, n:{}'.format(n, self.name))
            n += 1


if __name__ == '__main__':
    p1 = Myprocess('小明')
    p1.start()
    """
    1. 开新进程
    2. 运行run()
    """
    p2 = Myprocess('小红')
    p2.start()
